package com.example.seckill.common.RabbitMQ;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Slf4j
@Service
public class MQSender {

    @Resource
    RabbitTemplate rabbitTemplate;

    /**发送秒杀信息**/
    public void sendOrderMessage(String msg){
        log.info("发送信息"+msg);
        rabbitTemplate.convertAndSend("seckillExchange","seckill.message",msg);

    }


//    public void send(String msg){
//        log.info("发送信息"+msg);
//        rabbitTemplate.convertAndSend("seckillExchange","seckill.message",msg);
//
//    }
}
